﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using YXChatFormClient.Dtos.Buddy;
using YXChatFormClient.Utility;

namespace YXChatFormClient.UserControls
{
    public partial class UC_BuddyInfo : UserControl
    {
        public UC_BuddyInfo()
        {
            InitializeComponent();
        }
        public BuddyAccountOutput BuddyAccountOutput { get; set; }

        private void UC_BuddyInfo_Load(object sender, EventArgs e)
        {
            this.lbNickName.Text = BuddyAccountOutput.Account.NickName;
            this.picAvatar.ImageLocation = ImageHelper.GetServerImage(BuddyAccountOutput.Account.Avatar);
            this.lbRemark.Text = BuddyAccountOutput.Account.NickName;
            this.lbArea.Text = BuddyAccountOutput.Account.Area;
            this.lbNumber.Text = BuddyAccountOutput.Account.AccountNumber;
            this.lbSignature.Text = BuddyAccountOutput.Account.Signature;
        }
        public delegate void GoToSendMsgHandler(BuddyAccountOutput buddyAccountOutput);
        public event GoToSendMsgHandler GoToSendMsgClick;
        private void btnGoToSendMsg_Click(object sender, EventArgs e)
        {
            if (GoToSendMsgClick != null) GoToSendMsgClick(BuddyAccountOutput);
        }
    }
}
